package com.lkm.asking.entity;

import org.springframework.web.multipart.MultipartFile;

import java.util.Objects;

public class Data {
    private Integer id;
    private String name;
    private String profitType;
    private double price;
    private String bookmark;
    private String introduce;
    private Integer star;
    private MultipartFile multipartFile;
    private String school;
    private Integer readCount;
    private String consumer;
    public String getConsumer(){return consumer;}
    public void setConsumer(String consumer){this.consumer=consumer;}
    private String img;
    public String getImg(){return img;}
    public void setImg(String img){this.img=img;}

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Data data = (Data) o;
        return Double.compare(data.price, price) == 0 &&
                Objects.equals(id, data.id) &&
                Objects.equals(name, data.name) &&
                Objects.equals(profitType, data.profitType) &&
                Objects.equals(bookmark, data.bookmark) &&
                Objects.equals(introduce, data.introduce) &&
                Objects.equals(star, data.star) &&
                Objects.equals(multipartFile, data.multipartFile) &&
                Objects.equals(school, data.school) &&
                Objects.equals(userName, data.userName)&&Objects.equals(readCount, data.readCount);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, profitType, price, bookmark, introduce, star, multipartFile, school, userName,readCount);
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public MultipartFile getMultipartFile() {
        return multipartFile;
    }

    public void setMultipartFile(MultipartFile multipartFile) {
        this.multipartFile = multipartFile;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    private String userName;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProfitType() {
        return profitType;
    }

    public void setProfitType(String profitType) {
        this.profitType = profitType;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getBookmark() {
        return bookmark;
    }

    public void setBookmark(String bookmark) {
        this.bookmark = bookmark;
    }

    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    public Integer getStar() {
        return star;
    }

    public void setStar(Integer star) {
        this.star = star;
    }
    public Integer getReadCount() {
        return readCount;
    }

    public void setReadCount(Integer readCount) {
        this.readCount = readCount;
    }
    @Override
    public String toString() {
        return "Data{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", profitType='" + profitType + '\'' +
                ", price=" + price +
                ", bookmark='" + bookmark + '\'' +
                ", introduce='" + introduce + '\'' +
                ", star=" + star +
                ", multipartFile=" + multipartFile +
                ", school='" + school + '\'' +
                ", userName='" + userName + '\'' +
                ",readCount="+readCount+
                '}';
    }
}
